"use strict";
const crypto = require("crypto");
module.exports = (app) => {
    const { STRING, INTEGER, DATE, ENUM } = app.Sequelize;
    // 配置（重要：一定要配置详细，一定要！！！）
    const File= app.model.define("file", {
        id: {
            type: INTEGER(30).UNSIGNED,
            primaryKey: true,
            autoIncrement: true
          },
          type: {
            type: STRING(200),
            allowNull: false,
            defaultValue: '',
            comment: '类型',
          },
          title:{
            type: STRING(200),
            allowNull: false,
            defaultValue: '',
            comment: '标题',
          },
          content: {
            type: STRING(5000),
            allowNull: false,
            defaultValue: '',
            comment: '内容',
          },
          order:{
            type: INTEGER(30),
            allowNull: false,
            defaultValue: 1,
            comment: '排序',
          },
          created_at: DATE,
          updated_at: DATE,

    });

    // 定义关联关系
    // Consume.associate = function (model) {
    //     Shop.belongsTo(app.model.Class);
        
    // };
    return File;
};
